<#import "base.ftl" as base/>
<#import "spring.ftl" as spring/>

<@base.baseTemplate title="search">
	
	<form name="search" action="" method="post">
		<div class="line"><label><@spring.message "searchCombination"/>:</label><input type="radio" name="searchCombination" value="and" <#if searchCombination == "and">checked="checked"</#if>><@spring.message "searchCombinationAND"/><br>
    	<input type="radio" name="searchCombination" value="or" <#if searchCombination == "or">checked="checked"</#if>><@spring.message "searchCombinationOR"/></div>
		<div class="line"><label><@spring.message "computerName"/>:</label><input type="text" name="computerName" value="${computerName!}" class="text" /></div>
		<div class="line"><label><@spring.message "ipAddress"/>:</label><input type="text" name="ipAddress" value="${ipAddress!}" class="text" /></div>
		<div class="line"><label><@spring.message "type"/>:</label><input type="text" name="type" value="${type!}" class="text" /></div>
		<div class="line"><label><@spring.message "cpuType"/>:</label><input type="text" name="cpuType" value="${cpuType!}" class="text" /></div>
		<div class="line"><label><@spring.message "operatingSystem"/>:</label><input type="text" name="operatingSystem" value="${operatingSystem!}" class="text" /></div>
		<br/>
		
		<div class="line"><input type="submit" value="<@spring.message "search"/>" class="submit button" /></div>
		
		<#if (result_list?size > 0)>
			<div class="line">
				<table class="ui-widget">
					<thead class="ui-widget-header">
						<tr>
					  		<th><@spring.message "computerName"/></th>
					  		<th><@spring.message "ipAddress"/></th>
					  		<th><@spring.message "type"/></th>
					  		<th><@spring.message "cpuType"/></th>
					  		<th><@spring.message "operatingSystem"/></th>
					  	</tr>
					</thead>
					<tbody class="ui-widget-content">
					  	<#list result_list as scanresult>
					  		<tr>
							  	<td><a href="${rc.getContextPath()}/scan/${scanresult.id}">${scanresult.computerName!}</a></td>
								<td>${scanresult.scanIpAddress!}</td>
								<td><@spring.message "pctype.${scanresult.computerType!}"/></td>
								<td>${scanresult.cpu!}</td>
							  	<td>${scanresult.operatingSystem!}</td>
					  		</tr>
						</#list>
					</tbody>
				</table>
			</div>
		</#if>
	</form>
</@base.baseTemplate>